<?php
require_once dirname(__FILE__) . '/../../../incls/php/dbutils.class.php';
require_once dirname(__FILE__) . '/../../../incls/php/miscutils.class.php';
$myPdo = DbUtils::createPdoInst();
$inst_id = MiscUtils::getParam('inid', 0);
$comp_track_id = MiscUtils::getParam('t', 0);
$cond_vals = new stdClass();
$cond_vals->c = 'comp_track_id = :v1 AND is_confirmed = 1';
$cond_vals->v = array(':v1' => $comp_track_id);
$opts = new stdClass();
$opts->select_expr = 'COUNT(t.id) AS total';
$total = DbUtils::get($myPdo, TABLE_NAME_PREFIX_PLUGIN . 'comp_entry', $cond_vals, NULL, NULL, NULL, NULL, $opts)->d[0]->total;
?>
<!DOCTYPE html>
<html>
<head>

  <meta charset="utf-8">

  <style>
    .box {
      background: #c1e8a5;
      font-size: 20px;
      border: 1px solid #39D728;
      width: 250px;
      padding: 10px 20px;
      text-align: center;
      margin-left: 80px;
    }
  </style>

</head>
<body>
<div class="box"><img src="total.png"></img>： <?php echo $total; ?></div>
</body>
</html>
